<ion-view view-title="牛股宝" >
    <ion-nav-buttons side="left" >
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-nav-buttons  side="right">
        <a ng-click="show()" class="button button-clear icon-right">排序</a>
    </ion-nav-buttons>
    <ion-content ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <!-- promo -->
        <input type="hidden" ng-model="channel.channelId" value="4655" keep-current-value/>
        <input type="hidden" ng-model="channel.adId" value="4616" keep-current-value/>

        <channel-img ng-click="showAds(true);"></channel-img>

        <div class="term" ng-show="vm.activeTab == 1">
            <div class="panel" ng-repeat="item in profitFunds">
                <a href="#/tab/product-item-QDII/{{item.contentId}}" >
                    <h2 class="item">{{item.contentName}}</h2>
                    <div class="item">
                        <p ng-if="item.prodStatus!=4"><em ng-class="{inc_ : item.rrInSingleYear< 0}">{{item.rrInSingleYear | defNumber : 2}}<sub>%</sub></em>近一年涨幅</p>
                        <p ng-if="item.prodStatus==4"><em >{{item.ipoEndDate | defDateString}}</em>认购截止日</p>
                        <p><em>{{item.prodNav | defNumber : 4}}<sub>元</sub></em>单位净值</p>
                        <p><em ng-bind-html="item.prodMinSubscribe"></em>起购金额</p>
                    </div>
                </a>
            </div>
        </div>


        <div class="term" ng-show="vm.activeTab == 2">
            <div class="panel" ng-repeat="item in profitFunds | orderBy : ['prodCxpj','rrInSingleYear']: true">
                <a href="#/tab/product-item-QDII/{{item.contentId}}" >
                    <h2 class="item">{{item.contentName}}</h2>
                    <div class="item">
                        <p ng-if="item.prodStatus!=4"><em ng-class="{inc_ : item.rrInSingleYear< 0}">{{item.rrInSingleYear | defNumber : 2}}<sub>%</sub></em>近一年涨幅</p>
                        <p ng-if="item.prodStatus==4"><em >{{item.ipoEndDate | defDateString}}</em>认购截止日</p>
                        <p><em>{{item.prodNav | defNumber : 4}}<sub>元</sub></em>单位净值</p>
                        <p><em class="grade g{{item.prodCxpj}}"></em>基金评级</p></div>
                </a>
            </div>
        </div>

        <div class="unlimited" ng-show="vm.activeTab == 3">
            <div class="niugu QDII-Top" ng-repeat="item in companyJson | orderBy : 'jjgscxpj' : true" ng-class="{on : item.isOpen}">
                <dl ng-click="item.isOpen = !item.isOpen">
                    <dt><img ng-src="{{item.titleImg}}"/></dt>
                    <dd><h2>{{item.name}}</h2>
                        <div class="increase"><em class="grade g{{item.jjgscxpj}}"></em>
                            <p>基金公司评级</p>
                        </div>
                    </dd>
                </dl>
                <div class="retract" ng-click="item.isOpen = !item.isOpen">收起</div>
                <div class="term" id="{{item.channelId}}_contents">
                    <div class="intro">{{item.description}}</div>
                    <div class="hd">相关基金</div>
                    <div class="panel" ng-repeat="fund in profitFunds | filter:{channelId :item.channelId}:true">
                        <a href="#/tab/product-item-QDII/{{fund.contentId}}" >
                            <h2 class="item">{{fund.contentName}}</h2>
                            <div class="item">
                                <p ng-if="item.prodStatus!=4"><em ng-class="{inc_ : fund.rrInSingleYear< 0}">{{fund.rrInSingleYear | defNumber : 2}}<sub>%</sub></em>近一年涨幅</p>
                                <p ng-if="item.prodStatus==4"><em >{{item.ipoEndDate | defDateString}}</em>认购截止日</p>
                                <p><em>{{fund.prodNav | defNumber : 4}}<sub>元</sub></em>单位净值</p>
                                <p><em ng-bind-html="fund.prodMinSubscribe"></em>起购金额</p>
                            </div>
                        </a>
                    </div>
                </div>
            </div>

        </div>

    </ion-content>
</ion-view>